package com.ruoyi.video.service.impl;

import com.ruoyi.video.domain.VideoProgress;
import com.ruoyi.video.mapper.VideoProgressMapper;
import com.ruoyi.video.service.IVideoProgressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 观看进度Service业务层处理
 *
 * @author ruoyi
 * @date 2022-02-08
 */
@Service
public class VideoProgressServiceImpl implements IVideoProgressService {
    @Autowired
    private VideoProgressMapper videoProgressMapper;

    /**
     * 查询观看进度
     *
     * @param id 观看进度主键
     * @return 观看进度
     */
    @Override
    public VideoProgress selectVideoProgressById(String id) {
        return videoProgressMapper.selectVideoProgressById(id);
    }

    /**
     * 查询观看进度列表
     *
     * @param videoProgress 观看进度
     * @return 观看进度
     */
    @Override
    public List<VideoProgress> selectVideoProgressList(VideoProgress videoProgress) {
        return videoProgressMapper.selectVideoProgressList(videoProgress);
    }

    /**
     * 新增观看进度
     *
     * @param videoProgress 观看进度
     * @return 结果
     */
    @Override
    public int insertVideoProgress(VideoProgress videoProgress) {
        return videoProgressMapper.insertVideoProgress(videoProgress);
    }

    /**
     * 修改观看进度
     *
     * @param videoProgress 观看进度
     * @return 结果
     */
    @Override
    public int updateVideoProgress(VideoProgress videoProgress) {
        return videoProgressMapper.updateVideoProgress(videoProgress);
    }

    /**
     * 批量删除观看进度
     *
     * @param ids 需要删除的观看进度主键
     * @return 结果
     */
    @Override
    public int deleteVideoProgressByIds(String[] ids) {
        return videoProgressMapper.deleteVideoProgressByIds(ids);
    }

    /**
     * 删除观看进度信息
     *
     * @param id 观看进度主键
     * @return 结果
     */
    @Override
    public int deleteVideoProgressById(String id) {
        return videoProgressMapper.deleteVideoProgressById(id);
    }

    @Override
    public int deleteVideoProgressByVideoId(String videoId) {
        return videoProgressMapper.deleteVideoProgressByVideoId(videoId);
    }
}
